package com.zy.chat.controller;


import com.zy.chat.entity.ChatGroup;
import com.zy.chat.entity.UserLogin;
import com.zy.chat.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping(value = "groupcontroller")
public class GroupController {


    @Autowired
    private GroupService groupService;
    @RequestMapping(value = "/group/{username}")
    public ResponseEntity<ChatGroup> selectByUserId(@PathVariable(value = "username")String username) throws Exception{
        ChatGroup chatGroup=this.groupService.selectByUserId(username);
        return new ResponseEntity<ChatGroup>(chatGroup, HttpStatus.OK);
    }

}
